iT邦幫忙

2022 iThome 鐵人賽

DAY 29
1
Modern Web

資料庫也有版本控制系列 第 29

Day 29 : 實際透過 Entity Framework Core Migration 與 Flyway 做不同資料庫的遷移

  • 分享至 

  • xImage
  •  

六、不同資料庫間的資料表遷移

Day 28 : 在不同資料庫間做遷移的方法
-> Day 29 : 實際透過 Entity Framework Core Migration 與 Flyway 做不同資料庫的遷移


昨日我們講到了在不同資料庫間做遷移的方法,我們今日實際進行一次方案,首先從整合度較高的 Entity Framework Core Migration 講起

當我們使用 Entity Framework Core Migration 做不同資料庫的連接時,我們可以在一個專案內起多個資料庫方案來處理,如下圖

https://ithelp.ithome.com.tw/upload/images/20221013/20116987iEHjLtJXTI.png

而 Entity Framework Core 除了 MSSQL 本家的驅動是由微軟維護外,其他都是由第三方的機構維護,舉 Postgresql 為例,就是由 npgsql.org 負責維護,因此會需要為不同的 Entity Framework Core Migration PJ 引用不同的 Entity Framework Core 版本與 Entity Framework Core Design 來驅動遷移與資料庫操作

當使用 Flyway 時,需要將語法改換成 Java ORM 來記錄,而 Flyway 本身就支援 Postgres、Oracle、SQL Server、DB2、H2、以及 MariaDB... 等大多數的關聯式資料庫,如 Entity Framework Core 一樣,只要是使用 Java Code 來記錄資料庫模型,就能直接進行搬移


後續預告

下一篇我們將會進入最後一篇的總結


上一篇
Day 28 : 在不同資料庫間做遷移的方法
下一篇
Day 30 : 資料庫做版本控制的總結
系列文
資料庫也有版本控制30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言